// 角色管理接口模块
import request from '@/utils/request'
// 所有角色列表
export const reqGetRolesList = (params) => {
  return request({
    method: 'get',
    url: '/sys/role',
    params
  })
}
// reqGetRolesList ({page:1, pagesize 10})

// 删除角色
export const reqDelRoleById = (id) => {
  return request({
    method: 'delete',
    url: `/sys/role/${id}`
  })
}
/** *
 * 新增角色
 * ***/
export function reqAddRole(data) {
  return request({
    url: '/sys/role',
    data,
    method: 'post'
  })
}
export const reqGetRoleDetail = (id) => {
  return request({
    url: `/sys/role/${id}`,
    method: 'GET'
  })
}
export const reqUpdateRole = (data) => {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'put',
    data: data
  })
}
// 给角色分配权限
export function reqAssignPerm(data) {
  return request({
    url: '/sys/role/assignPrem',
    method: 'put',
    data
  })
}
